{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 49,
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "not enough values to unpack (expected 2, got 0)",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mValueError\u001B[0m                                Traceback (most recent call last)",
      "Input \u001B[1;32mIn [49]\u001B[0m, in \u001B[0;36m<cell line: 3>\u001B[1;34m()\u001B[0m\n\u001B[0;32m      1\u001B[0m \u001B[38;5;28;01mfrom\u001B[39;00m \u001B[38;5;21;01mmootdx\u001B[39;00m\u001B[38;5;21;01m.\u001B[39;00m\u001B[38;5;21;01mquotes\u001B[39;00m \u001B[38;5;28;01mimport\u001B[39;00m Quotes\n\u001B[1;32m----> 3\u001B[0m client \u001B[38;5;241m=\u001B[39m \u001B[43mQuotes\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mfactory\u001B[49m\u001B[43m(\u001B[49m\u001B[43mmarket\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mstd\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[0;32m      4\u001B[0m client\u001B[38;5;241m.\u001B[39mbars(symbol\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124m600036\u001B[39m\u001B[38;5;124m'\u001B[39m, frequency\u001B[38;5;241m=\u001B[39m\u001B[38;5;241m9\u001B[39m, offset\u001B[38;5;241m=\u001B[39m\u001B[38;5;241m10\u001B[39m)\n",
      "File \u001B[1;32mE:\\python\\lib\\site-packages\\mootdx\\quotes.py:42\u001B[0m, in \u001B[0;36mQuotes.factory\u001B[1;34m(market, **kwargs)\u001B[0m\n\u001B[0;32m     39\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m market \u001B[38;5;241m==\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mext\u001B[39m\u001B[38;5;124m\"\u001B[39m:\n\u001B[0;32m     40\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m ExtQuotes(\u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs)\n\u001B[1;32m---> 42\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m StdQuotes(\u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs)\n",
      "File \u001B[1;32mE:\\python\\lib\\site-packages\\mootdx\\quotes.py:150\u001B[0m, in \u001B[0;36mStdQuotes.__init__\u001B[1;34m(self, server, bestip, timeout, **kwargs)\u001B[0m\n\u001B[0;32m    147\u001B[0m         \u001B[38;5;28;01mdel\u001B[39;00m kwargs[x]\n\u001B[0;32m    149\u001B[0m logger\u001B[38;5;241m.\u001B[39mdebug(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mserver: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mserver\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m)\n\u001B[1;32m--> 150\u001B[0m ip, port \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mserver\n\u001B[0;32m    152\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mclient \u001B[38;5;241m=\u001B[39m TdxHq_API(heartbeat\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mFalse\u001B[39;00m, auto_retry\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mTrue\u001B[39;00m, raise_exception\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mFalse\u001B[39;00m, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs)\n\u001B[0;32m    153\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mclient\u001B[38;5;241m.\u001B[39mconnect(ip, \u001B[38;5;28mint\u001B[39m(port), time_out\u001B[38;5;241m=\u001B[39mtimeout)\n",
      "\u001B[1;31mValueError\u001B[0m: not enough values to unpack (expected 2, got 0)"
     ]
    }
   ],
   "source": [
    "from mootdx.quotes import Quotes\n",
    "\n",
    "client = Quotes.factory(market='std')\n",
    "client.bars(symbol='600036', frequency=9, offset=10)"
   ],
   "metadata": {
    "collapsed": false
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
